package com.hrp.controller;

import com.hrp.domain.Menus;
import com.hrp.domain.User;
import com.hrp.service.MenusService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Created by Administrator on 2018/8/2 0002.
 */
@RestController
@RequestMapping("menus")
public class MenusController {


    @Autowired
    private MenusService menusService;


    @RequestMapping("/getMenus")
    public List<Menus> getMenusData(){

        User acount = (User)SecurityUtils.getSubject().getPrincipal();
        return menusService.getMenus(acount.getUsername());
    }

}
